package org.wekit.engine.pvm.runtime;

import org.wekit.engine.pvm.PvmProcessElement;
import org.wekit.engine.pvm.PvmProcessInstance;
import org.wekit.engine.pvm.PvmTransition;
import org.wekit.engine.pvm.delegate.ActivityExecution;
import org.wekit.engine.pvm.delegate.ExecutionListenerExecution;
import org.wekit.engine.pvm.process.Activity;
import org.wekit.engine.pvm.process.ProcessDefinition;

/**
 * 流程中断执行类
 * @author HuangWeili
 *
 */
public interface InterpretableExecution extends ActivityExecution,ExecutionListenerExecution,PvmProcessInstance {

	void take(PvmTransition transition);
	
	void setEventName(String eventName);
	
	void setEventSource(PvmProcessElement processElement);
	
	int getExecutionListenerIndex();
	
	void setExecutionListenerIndex(int index);

	ProcessDefinition getProcessDefinition();
	
	void setActivity(Activity activity);
	
	/**
	 * 事件流转函数
	 * @param atomicOperation
	 */
	void performOperation(AtomicOperation atomicOperation);
	
	boolean isScope();
	
	void destroy();
	
	void remove();
	
	/**
	 * 初始化
	 */
	void initialize();
	
	/**
	 * 
	 * @param processDefinition
	 */
	void setProcessDefinition(ProcessDefinition processDefinition);
	
	void setProcessInstance(InterpretableExecution processInstance);
}
